# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=malicious-pdf
pkgver=64.5676086
pkgrel=1
pkgdesc='Generate a bunch of malicious pdf files with phone-home functionality.'
arch=('any')
groups=('blackarch' 'blackarch-webapp' 'blackarch-malware')
url='https://github.com/jonaslejon/malicious-pdf'
license=('BSD-2-Clause')
depends=('python')
makedepends=('git')
source=("git+https://github.com/jonaslejon/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

